Skip to content

fix(server): stop npx service updates from silently leaving the old server running - #5217

Merged
t3dotgg merged 1 commit into
mainfrom
fix/service-launcher-npx-source
Aug 2, 2026
Merged

fix(server): stop npx service updates from silently leaving the old server running#5217
t3dotgg merged 1 commit into
mainfrom
fix/service-launcher-npx-source

Conversation

@t3dotgg

@t3dotgg t3dotgg commented Aug 2, 2026

Copy link
Copy Markdown
Member

Updating T3 Code with npx t3@nightly connect failed on my machine. It downloaded the new version, then reported "Could not set up the T3 Code background service" and left the old server running. Retrying and rebooting did not help.

The installer looked for service-launcher.mjs next to process.argv[1]. Under npx that path is the node_modules/.bin/t3 symlink, and Node keeps the symlink path in argv[1], so it searched a bin directory that has no launcher. The read failed before systemd was stopped, so the update aborted with the previous version still serving.

It now reads the launcher from the pinned runtime the installer just prepared and verified, which is the same place the version is staged for every install path.

Verified on bb-1: the repair completed, systemd now runs the launcher with the new server as its child, and the machine came back reachable over the relay.

Made by Claude Opus 5 in Claude Code.


Note

Medium Risk
Changes install-time file resolution for the systemd background service on Linux; wrong paths would break updates, but scope is limited to boot service setup and covered by a new test.

Overview
Fixes background service setup when the CLI runs via npx, where the installer used to look for service-launcher.mjs beside process.argv[1] (often a node_modules/.bin symlink with no launcher). That read failed before systemd was updated, so updates aborted and the old server kept running.

BootService now defaults the launcher source to the pinned runtime directory prepared and verified during install—the same staging path used for every install flow. cliEntryPath and HostProcessArguments are removed from BootServiceHost; an explicit launcherSourcePath override remains.

A test confirms install copies the launcher from the pinned runtime when no override is set.

Reviewed by Cursor Bugbot for commit 747860a. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Fix npx service updates leaving old server running by resolving launcher from pinned runtime

When host.launcherSourcePath is not provided, the launcher is now copied from the pinned runtime directory (service-launcher.mjs alongside the pinned runtime entry) rather than from the host CLI entry path directory. This fixes a bug where npx service updates would silently leave the old server running because the wrong launcher was used.

  • Removes cliEntryPath from the BootServiceHost interface in bootService.ts and stops reading HostProcessArguments
  • Adds a test case in bootService.test.ts that verifies the launcher is copied from the pinned runtime directory during install

Macroscope summarized 747860a.

The installer resolved service-launcher.mjs from process.argv[1], which is
the .bin/t3 symlink under npx. That directory has no launcher, so the update
failed before stopping systemd and the old server kept running.

Source the launcher from the pinned runtime the installer just prepared.

Co-Authored-By: Claude <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Aug 2, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro Plus

Run ID: a46a7413-eb39-43db-a32a-17b2f17c1ca9

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added size:S 10-29 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. labels Aug 2, 2026
@macroscopeapp

macroscopeapp Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved 747860a

This is a focused bug fix that changes path resolution for the service launcher source from the ephemeral CLI entry path to the pinned runtime path. The change is small, includes a test, and addresses a clear issue with npx-based updates. Low risk.

You can customize Macroscope's approvability policy. Learn more.

@t3dotgg
t3dotgg merged commit 64bf016 into main Aug 2, 2026
17 checks passed
@t3dotgg
t3dotgg deleted the fix/service-launcher-npx-source branch August 2, 2026 05:42
github-actions Bot added a commit to omarcresp/t3code-flake that referenced this pull request Aug 2, 2026
## What's Changed
* fix(server): stop npx service updates from silently leaving the old server running by @t3dotgg in pingdotgg/t3code#5217


**Full Changelog**: pingdotgg/t3code@v0.0.32-nightly.20260801.976...v0.0.32-nightly.20260802.979

Upstream release: https://github.com/pingdotgg/t3code/releases/tag/v0.0.32-nightly.20260802.979
phoenixtail26 added a commit to phoenixtail26/t3code that referenced this pull request Aug 3, 2026
22 upstream commits (through 30c9622). Two conflicts, both in fork
contact files:

- apps/server/src/serverRuntimeStartup.ts: upstream restructured make()
  into make(options?: StartupOptions) with a service-launcher client
  (pingdotgg#5217). Took upstream wholesale, re-applied the fork's delta: the
  ExternalSessionsWatcher import/acquisition/start phase and the
  repository-root auto-bootstrap (RepositoryIdentityResolver).
- apps/web/src/components/SidebarV2.tsx: upstream wrapped the thread
  list in an isSearchingThreads conditional for sidebar search (pingdotgg#4769).
  Took upstream, re-inserted the fork's <SidebarV2ExternalSessions>
  mount inside the non-searching TooltipProvider branch, before
  </TooltipProvider>, re-indented one level.

pnpm-lock.yaml auto-merged; `corepack pnpm install --lockfile-only`
confirmed it consistent (no changes). Tripwire drops were all
re-indentation of consciously re-applied lines. vp run typecheck and
vp check both 0 errors.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
stevesarmiento added a commit to stevesarmiento/harness that referenced this pull request Aug 3, 2026
…nus, server fixes

25 upstream commits (through 6f04a5c): settings sidebar search (pingdotgg#4682),
sidebar thread search (pingdotgg#4769), libghostty-vt terminal renderer (pingdotgg#4860,
pingdotgg#5102), legacy-model menu folding (pingdotgg#5190), npx t3 pair QR (pingdotgg#4955), bounded
catch-up replay (pingdotgg#5147), rollback-safe updates (pingdotgg#5181/pingdotgg#5095/pingdotgg#5217), PR
branch-drift threading (pingdotgg#5159), no auto-settle with open PRs (pingdotgg#5151),
interface spacing polish (pingdotgg#5252), and fixes.

Forma preserved: composer 40px squircle, sidebar chrome + separator
removal, Forma icon art, index.css sections (pixel grid et al), desktop
identity + ~/.forma default (now via DesktopStatePaths helper), settings
IA (nav renders Forma sections; upstream search indexes both IAs, fork
sections registered in settingsSearch), GitActions commit dialog,
ghostty terminal chrome colors generated from the Forma theme with
setTheme observers and code-font sizing intact.

Deferred: MobileRunContextSelector (BranchToolbar rename side), upstream
quick-action popover styling in GitActionsControl.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S 10-29 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant